<!--{template 'header'}-->
<!-- Container -->
<div id="container">
  <div class="shell">
    <!-- Main -->
    <div id="main">
      <div class="cl">&nbsp;</div>
      <!-- Content -->
      <div id="content">
      <!-- Box -->
        <div class="box">
          <!-- Box Head -->
          <div class="box-head">
            <h2>新增/修改活动事件</h2>
          </div>
          <!-- End Box Head -->
          <form action="#" method="post">
            <!-- Form -->
            <div class="form">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <th width="20%">时间</th>
                <th colspan="2">事件类别</th>
                <th width="21%">信息/对象</th>
                <th width="14%">分数</th>
                </tr>
              <tr>
                <td align="center"><input name="re_id" type="hidden" id="re_id" value="$ev[re_id]" />
                  <input name="raid_id" type="hidden" id="raid_id" value="$raid[r_id]" />
                  <input name="dt" type="text" class="field" id="dt" value="$ev[dt]" /></td>
                <td width="26%" align="right">
                	<select name="type" class="field" id="type">
                      <option value="0">请选择</option>
					  <!--{echo html_options($opt_event, $ev[type])}-->
					</select></td>
                <td width="19%" align="left"><select name="player_id" class="field hidden" id="player_id">
                <option value="0">请选择</option>
                  <!--{echo html_options($opt_players, $ev[player_id])}-->
                </select></td>
                <td align="center"><input name="info" type="text" class="field hidden" id="info" value="$ev[info]" /></td>
                <td align="center"><input name="dkp" type="text" class="field hidden" id="dkp" value="<!--{echo abs($ev[dkp])}-->" size="6" /></td>
                </tr>
            </table>
            </div>
            <!-- End Form -->
            <!-- Form Buttons -->
            <div class="buttons">
              <input type="submit" class="button" value="确认修改" />
            </div>
            <!-- End Form Buttons -->
          </form>
        </div>
        <!-- End Box -->
        <!-- Box -->
        <div class="box">
          <!-- Box Head -->
          <div class="box-head">
            <h2 class="left">$raid[r_title] - 事件列表</h2>
            <div class="right">
            </div>
          </div>
          <!-- End Box Head -->
          <!-- Table -->
          <div class="table">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <th width="20%">时间</th>
                <th width="17%">事件类别</th>
                <th width="26%">信息</th>
                <th width="11%">成员</th>
                <th width="11%">分数</th>
                <th width="15%">操作</th>
              </tr>
              <!--{loop $Raid->events $row}-->
              <tr class="odd">
                <td>$row[dt]</td>
                <td>$row[type]</td>
                <td>$row[info]</td>
                <td>$opt_players[$row[player_id]]</td>
                <td>$row[dkp]</td>
                <td><a href="./?admin/ev&raidid=$raid[r_id]&evid=$row[re_id]" class="ico edit">改</a> <a href="./?admin/delev&evid=$row[re_id]&raidid=$raid[r_id]" class="ico del">删</a></td>
              </tr>
              <!--{/loop}-->
            </table>
                        <!-- Pagging -->
            <div class="pagging">
              <div class="left"></div>
              <div class="right"><input name="按钮" type="button" class="button" value="基本信息" onclick="location.href='./?admin/info&raidid=$raid[r_id]'" /> <input name="按钮" type="button" class="button" value="参加人员" onclick="location.href='./?admin/members&raidid=$raid[r_id]'" /> 
              <input name="按钮" type="button" class="button" value="查看报告"  onclick="location.href='./?report&raidid=$raid[r_id]'" />
              </div>
            </div>
            <!-- End Pagging -->
          </div>
          <!-- Table -->
        </div>
        <!-- End Box -->
      </div>
      <!-- End Content -->
      <!-- Sidebar -->
	  <!--{template 'raid_side'}-->
	  <!-- End Sidebar -->
      <div class="cl">&nbsp;</div>
    </div>
    <!-- Main -->
  </div>
</div>
<!-- End Container -->
<!--{template 'footer'}-->
<script language="javascript">
$(document).ready(function(){
	$('#dt').datetime({
		userLang	: 'zh-CN',
		americanMode: false
	});
	
	if($('#type').val()=='0')
	{
		$('#player_id').hide();
		$('#info').hide();
		$('#dkp').hide();
	}
	
	<!--{loop $events $row}-->
	if($('#type').val()=='$row[t_name]')
	{	
		<!--{if $row[show_player]}-->
		$('#player_id').show();
		<!--{else}-->
		$('#player_id').hide();
		<!--{/if}-->
		<!--{if $row[show_info]}-->
		$('#info').show();
		<!--{else}-->
		$('#info').hide();
		<!--{/if}-->
		<!--{if $row[show_dkp]}-->
		$('#dkp').show();
		<!--{else}-->
		$('#dkp').hide();
		<!--{/if}-->
	}
	<!--{/loop}-->
	
	$('#type').change(function(){
		if($(this).val()=='0')
		{
			$('#player_id').hide();
			$('#info').hide();
			$('#dkp').hide();
		}
		<!--{loop $events $row}-->
		if($(this).val()=='$row[t_name]')
		{	
			<!--{if $row[show_player]}-->
			$('#player_id').show();
			<!--{else}-->
			$('#player_id').hide();
			<!--{/if}-->
			<!--{if $row[show_info]}-->
			$('#info').show();
			<!--{else}-->
			$('#info').hide();
			<!--{/if}-->
			<!--{if $row[show_dkp]}-->
			$('#dkp').show();
			<!--{else}-->
			$('#dkp').hide();
			<!--{/if}-->
		}
		<!--{/loop}-->
	});
});
</script>